﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Controls.Primitives;

namespace DiscoveryLogic.UI.Layouts.WrappedControls
{

    public class Button : System.Windows.Controls.Button 
    {
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            System.Diagnostics.Debug.WriteLine("Button:OnApplyTemplate ()"); 
        }

        public Button()
            : base()
        {
            DefaultStyleKey = typeof(Button);
        }

        public Visibility ReflectionVisibility
        {
            get { return (Visibility)GetValue(ReflectionVisibilityProperty); }
            set { SetValue(ReflectionVisibilityProperty, value); }
        }

        // Using a DependencyProperty as the backing store for ReflectionVisibility.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty ReflectionVisibilityProperty =
            DependencyProperty.Register("ReflectionVisibility", typeof(Visibility), typeof(Button), null); 


    }


   
    public class VideoToggleButton : System.Windows.Controls.Primitives.ToggleButton 
    {
        public VideoToggleButton()
            : base()
        {
            DefaultStyleKey = typeof(VideoToggleButton);
        }

        public override void OnApplyTemplate()
        {
               base.OnApplyTemplate();
                System.Diagnostics.Debug.WriteLine("Button:OnApplyTemplate ()"); 
        }
    } 

    public class Slider : System.Windows.Controls.Slider
    {

        public Slider()
            : base()
        {
            DefaultStyleKey = typeof(Slider);
        } 

        public Slider( double min, double max ) : base () 
        {
            this.Minimum = min;
            this.Maximum = max;

            DefaultStyleKey = typeof(Slider);
        }

        public Slider(double sliderBarWidth, double sliderMinValue, double sliderMaxValue)
        {
            // Required to initialize variables
            this.Width = sliderBarWidth;   
            this.Minimum= sliderMinValue;
            this.Maximum = sliderMaxValue;


            DefaultStyleKey = typeof(Slider);

            //JAIMERTODO 
            /* 
            mouseEventManager = new MouseManager("horizontal", barLeft, barWidth, thumbWidth);

            // Hook up event handlers
            SliderThumb.MouseEnter += mouseEventManager.OnMouseEnterHand;
            SliderThumb.MouseLeave += mouseEventManager.OnMouseLeaveArrow;
            SliderThumb.MouseLeftButtonDown += mouseEventManager.SliderMouseDown;
            SliderThumb.MouseLeftButtonUp += mouseEventManager.SliderMouseUp;
            SliderThumb.MouseMove += mouseEventManager.SliderMouseMove;

            mouseEventManager.sliderMove += new MouseManager.SliderMoveEventHandler(OnSliderThumbMove);
             */ 
        }



        public double Percent
        {
            get
            {                 
                return this.Value / (this.Maximum - this.Minimum); 
            }
            set
            {
                //TODO : Decide if this is needed.. 
                throw new NotImplementedException();
            }
        } 
    }


    public class Slider2 : System.Windows.Controls.Slider
    {

        public Slider2()
            : base()
        {
            DefaultStyleKey = typeof(Slider);
        }

        public Slider2(double min, double max)
            : base()
        {
            this.Minimum = min;
            this.Maximum = max;

            DefaultStyleKey = typeof(Slider);
        }

        public Slider2(double sliderBarWidth, double sliderMinValue, double sliderMaxValue)
        {
            // Required to initialize variables
            this.Width = sliderBarWidth;
            this.Minimum = sliderMinValue;
            this.Maximum = sliderMaxValue;

            DefaultStyleKey = typeof(Slider);

            //JAIMERTODO 
            /* 
            mouseEventManager = new MouseManager("horizontal", barLeft, barWidth, thumbWidth);

            // Hook up event handlers
            SliderThumb.MouseEnter += mouseEventManager.OnMouseEnterHand;
            SliderThumb.MouseLeave += mouseEventManager.OnMouseLeaveArrow;
            SliderThumb.MouseLeftButtonDown += mouseEventManager.SliderMouseDown;
            SliderThumb.MouseLeftButtonUp += mouseEventManager.SliderMouseUp;
            SliderThumb.MouseMove += mouseEventManager.SliderMouseMove;

            mouseEventManager.sliderMove += new MouseManager.SliderMoveEventHandler(OnSliderThumbMove);
             */
        }



        public double Percent
        {
            get
            {
                return this.Value / (this.Maximum - this.Minimum);
            }
            set
            {
                //TODO : Decide if this is needed.. 
                throw new NotImplementedException();
            }
        }
    } 


}
